
let baseUrl="http://localhost:5000/api"
let Http =({url,dataObj,method,headers})=>{
  return new Promise((resolve,reject)=>{
    wx.request({
      url: baseUrl+url,
      method:method || "get",
      data:dataObj || {},
      header:headers || {},
      success:res=>{
        resolve(res.data);
      },
      fail:err=>{
        reject(err)
      }
    })
  })
}

export default Http;